import { createStore } from 'vuex'

export default createStore({
  state: {
    loginInfo:localStorage.getItem("loginInfo")?JSON.parse(localStorage.getItem("loginInfo")):null,
    baseURL:"http://127.0.0.1:8000/",
    userInfo:localStorage.getItem("userInfo")?JSON.parse(localStorage.getItem("userInfo")):null
  },
  getters: {
  },
  mutations: {
    setLoginInfo(state,data){
      state.loginInfo = data;
      localStorage.setItem("loginInfo",JSON.stringify(data));
    },
    setUserInfo(state,data){
      state.userInfo = data;
      localStorage.setItem("userInfo",JSON.stringify(data));
    }
  },
  actions: {
  },
  modules: {
  }
})
